<!DOCTYPE html>
<html>
	<link rel="stylesheet" type="text/css" href="./css/reset.css"/>
	<link rel="stylesheet" type="text/css" href="./css/toubu_dibu_gudingdingwei.css"/>
	<link rel="stylesheet" type="text/css" href="./css/wenda.css"/>
	<link rel="stylesheet" type="text/css" href="./css/zixun.css"/>
	<body>
	<!-- 头部开始 -->
	<div class="top">
		<div class="content ">
			
			<!-- 左浮动 -->
			<div class="fl">
				<a href="index.html"><img src="./images/logo.jpg" alt=""></a>
				<ul>
					<li><a href="index.html">课程</a></li>
					<li><a href="zixun.html">资讯</a></li>
					<li><a href="teacher.html">讲师</a></li>
					<li><a href="tiku.html">题库</a></li>
					<li><a href="wenda.html">问答</a></li>
					<div class="cl"></div>
				</ul>
			</div>
			
			<!-- 右浮动 -->
			<div class="fr">
				<a href="denglu.html">登录</a>
			</div>
			
			<!-- 清浮动 -->
			<div class="cl">
				
			</div> 
			
		</div>
	</div>
	<!-- 头部结束 -->
	
	<!-- 问答开始 -->
	<div class="wenda">
		<div class="content">
			
			<div class="wenda_a">
				<div style="float: left;">
					<img src="./images/t2.jpg" alt="">
					
				</div>
				<div class="fr">
					<p class="p1">英语四级 <i><a href="demo.html">更新中</a></i></p>
					<p class="p2">总课时：<b>30分钟</b></p>
					<p class="p2">课程时长：<b>3小时20分</b></p>
					<p class="p2">学习人数：<b>443223人</b></p>
					<p class="p2">讲师：杨凌霄老师<b></b></p>
					<p class="p2">课程评价：5.0分（1000000人评价）</p>
				
				<div>
					<span><a href="index.html">加入我们</a></span>
					
				</div>
					
				</div>
				<div class="cl"></div>
				
			</div>
		<script>
			if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
				xmlhttp = new XMLHttpRequest();
			} else { // code for IE6, IE5
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			xmlhttp.open("GET", "../xml/class.xml", false);
			xmlhttp.send();
			//由页面解析器创建xmlDoc对象
			xmlDoc = xmlhttp.responseXML;

			document.write("<table border='1' width='100%'>");
			var x = xmlDoc.getElementsByTagName("student");
				document.write("<tr height='100px'><th>班级名称</th><th>班级人数</th><th>课程编号</th><th>课程名称</th><th>总学时</th><th>授课日期</th><th>星期</th></tr>");
			for (i = 0; i < x.length; i++) {
				document.write("<tr height='100px'><td>");
				//getElementsByTagName("name")[0]返回节点的数组
				//获取返回节点数组的第一个元素
				//childNodes[0]元素的第一个子节点 (文本节点)，nodeValue节点的值 (文本自身) 
				document.write(x[i].getElementsByTagName("name")[0].childNodes[0].nodeValue);
				document.write("</td><td>");
				document.write(x[i].getElementsByTagName("age")[0].childNodes[0].nodeValue);
				document.write("</td><td>");
				document.write(x[i].getElementsByTagName("age")[0].childNodes[0].nodeValue);
				document.write("</td><td>");
				document.write(x[i].getElementsByTagName("age")[0].childNodes[0].nodeValue);
				document.write("</td><td>");
				document.write(x[i].getElementsByTagName("age")[0].childNodes[0].nodeValue);
				document.write("</td><td>");
				document.write(x[i].getElementsByTagName("age")[0].childNodes[0].nodeValue);
				document.write("</td><td>");
				document.write(x[i].getElementsByTagName("school")[0].childNodes[0].nodeValue);
				document.write("</td></tr>");
			}
			
			document.write("</table>");
		</script>

	</body>
</html>
